@extends('default.layouts.english.companyPublic')

@section('title', '企业基本资料')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/company/basic_info.css')}}">
@endsection

@section('rightcon')

    <div class="right">
        <div class="basicInfoForm">
            <div class="regInfo">
                {{--内菜单--}}
                <div class="jobtitle">
                    <div class="tithead">
                        <ul>
                            <li class="active"><a href="{{url('company/english/basic_info')}}">{{trans('english.Basic')}}</a></li>
                        </ul>
                    </div>
                </div>
                {{--公司信息--}}
                <form action="{{url('company/english/basic_info')}}" method="post" onSubmit="return false" name="regBasicForm"
                      id="regBasicForm">
                    <input type="hidden" id="id" name="id" value="{{$CompanyBasic->id}}">
                    {{csrf_field()}}
                    <div class="regForm comInfo">
                        <div class="fTitle">
                            <span class="line"><span>{{trans('english.Essential')}}</span></span>
                        </div>
                        {{--输出全部错误信息--}}
                        @if(count($errors)>0)
                            <div class="errors" style=" margin-top: 15px">
                                <ul>
                                    @if(is_object($errors))
                                        @foreach($errors->all() as $error)
                                            <li><span>{{$error}}</span></li>
                                        @endforeach
                                    @else
                                        <li><span>{{$errors}}</span></li>
                                    @endif
                                </ul>
                            </div>
                        @endif
                        <div class="formCon">
                            <dl>
                                <dt><span class="caption">{{trans('english.companyName')}}</span><span class="asterisk">*</span></dt>
                                <dd><input type="text" name="company_name" id="company_name"
                                           value="{{$CompanyBasic->company_name}}" placeholder="{{trans('english.pleaseCompany')}}" tip="{{trans('english.pleaseCompany')}}">
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.brand')}}</span></dt>
                                <dd><input type="text" name="brands" id="brands" style="width: 222px;"
                                           value="{{$CompanyBasic->brands}}" placeholder="{{trans('english.PleaseBrand')}}" tip="{{trans('english.PleaseBrand')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.nature')}}</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="comkind" name="comkind" type="hidden">
                                    <div id="comkind_select" class="select"><span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.industry')}}</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="industry" name="industry" type="hidden">
                                    <div id="industry_select" class="select" style="width: 240px;">
                                        <span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.founded')}}</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <div class="showTime" id="showTime">
                                        <input name="established" id="established" type="hidden"
                                               value="{{$CompanyBasic->established}}">
                                    </div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl>
                                <dt><span class="caption">{{trans('english.employees')}}</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="employee_num" name="employee_num" type="hidden">
                                    <div id="employee_num_select" class="select"><span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.Corporate')}}</span><span class="asterisk">*</span></dt>
                                <dd style="width: 570px;">
                                    <span class="selTemptation" id="selTemptation">
                                        <input name="temptation" value="{{$CompanyBasic->temptation}}" id="temptation"
                                               type="hidden">
                                        <input type="text" name="showTemptation" id="showTemptation"
                                               value="{{$CompanyBasic->temptation}}" readonly style="cursor: text"
                                               placeholder="The bag eats, encase, five social insurance and one housing fund, the boss who is good">
                                        <i class="yicon"></i>
                                    </span>
                                </dd>
                                <dd class="errinfo" style="width: 140px;"></dd>
                            </dl>
                            <dl style=" height: 112px;">
                                <dt style=" height: 112px;"><span class="caption">{{trans('english.CompanyPro')}}</span><span
                                            class="asterisk">*</span></dt>
                                <dd style=" height: 112px;"><textarea name="profile" id="profile" placeholder="{{trans('english.PleaseProfile')}}"
                                                                      tip="{{trans('english.PleaseProfile')}}">{{$CompanyBasic->profile}}</textarea>
                                </dd>
                                <dd class="errinfo" style="width: 140px;"></dd>
                            </dl>
                        </div>
                    </div>

                    {{--联系方式--}}
                    <div class="regForm comInfo">
                        <div class="fTitle">
                            <span class="line"><span>{{trans('english.Contact')}}</span></span>
                        </div>
                        <div class="formCon">
                            <dl>
                                <dt><span class="caption">{{trans('english.Contacts')}}</span><span class="asterisk">*</span></dt>
                                <dd><input type="text" name="contacts" id="contacts" style=" width: 180px;"
                                           value="{{$CompanyBasic->contacts}}" placeholder="{{trans('english.PleaseContact')}}" tip="{{trans('english.PleaseContact')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.Phone')}}</span></dt>
                                <dd><input type="text" name="mobile" id="mobile" value="{{$CompanyBasic->mobile}}"
                                           placeholder="{{trans('english.PleasePhone')}}" tip="{{trans('english.PleasePhone')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl>
                                <dt><span class="caption">{{trans('english.contact')}}</span></dt>
                                <dd>
                                    <input type="text" name="area_code" id="area_code" style="width:50px;"
                                           value="{{$CompanyBasic->area_code}}" placeholder="Area code">
                                    <input type="text" name="phone" id="phone" style="width:140px; margin-left: 10px;"
                                           value="{{$CompanyBasic->phone}}" placeholder="Fixed telephone" tip="Please enter the phone">
                                    <input type="text" name="ext" id="ext" style="width:50px;margin-left: 10px;"
                                           value="{{$CompanyBasic->ext}}" placeholder="Extension number">
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl style=" margin: 0">
                                <dt></dt>
                                <dd class="tips"><span class="asterisk">*</span>Fixed telephone and mobile phone numbers must be filled out</dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.Fax')}}</span></dt>
                                <dd><input type="text" name="fax" id="fax" value="{{$CompanyBasic->fax}}"
                                           style=" width: 160px;" placeholder="{{trans('english.PleaseFax')}}" tip="{{trans('english.PleaseFax')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.E-mail')}}</span></dt>
                                <dd><input type="text" name="email" id="email" value="{{$CompanyBasic->email}}"
                                           style=" width:240px;" placeholder="{{trans('english.PleaseE-mail')}}" tip="{{trans('english.PleaseE-mail')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.QQNumber')}}</span></dt>
                                <dd><input type="text" name="qq" id="qq" value="{{$CompanyBasic->qq}}"
                                           style=" width: 160px;" placeholder="{{trans('english.PleaseQQ')}}" tip="{{trans('english.PleaseQQ')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.Location')}}</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="region" name="region" type="hidden" value="{{$CompanyBasic->region}}">
                                    <input id="province" name="province" type="hidden">
                                    <div id="province_select" class="select"><span><a></a></span><i></i></div>
                                    <input id="area" name="area" type="hidden">
                                    <div id="area_select" class="select" style="margin-left: 5px;">
                                        <span><a></a></span><i></i></div>
                                    <input id="city" name="city" type="hidden" value="{{$CompanyBasic->region}}">
                                    <div id="city_select" class="select" style="margin-left: 5px;">
                                        <span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.detailedAddress')}}</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input type="text" name="address" id="address" style="width:400px;"
                                           value="{{$CompanyBasic->address}}" placeholder="{{trans('english.PleaseAddress')}}" tip="{{trans('english.PleaseAddress')}}">
                                </dd>
                                <dd class="errinfo" style="width: 140px;"></dd>
                            </dl>

                            <dl class="setMapCss">
                                <dt></dt>
                                <dd>
                                    <input name="position" type="hidden" id="position"
                                           value="@if($CompanyBasic->longitude){{$CompanyBasic->longitude}},{{$CompanyBasic->latitude}},{{$CompanyBasic->coordinate_address}}@endif"/>
                                    <input name="coordinate_address" type="hidden" id="coordinate_address"
                                           value="{{$CompanyBasic->coordinate_address}}"/>
                                    <input name="longitude" type="hidden" id="longitude"
                                           value="{{$CompanyBasic->longitude}}"/>
                                    <input name="latitude" type="hidden" id="latitude"
                                           value="{{$CompanyBasic->latitude}}"/>
                                    <span class="setmap"><a id="setMap">{{trans('english.Set')}}</a></span>
                                    @if($CompanyBasic->longitude)
                                        <span class="noset" id="noset"
                                              style="color: #999">Map location has been set：{{$CompanyBasic->coordinate_address}}</span>
                                    @else
                                        <span class="noset" id="noset">{{trans('english.NotSet')}}</span>
                                    @endif
                                </dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.Website')}}</span></dt>
                                <dd><input type="text" name="website" id="website" style="width:240px;"
                                           value="{{$CompanyBasic->website}}" placeholder="{{trans('english.PleaseWebsite')}}" tip="{{trans('english.PleaseWebsite')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">{{trans('english.BusLine')}}</span></dt>
                                <dd><input type="text" name="lines" id="lines" value="{{$CompanyBasic->lines}}"
                                           style="width:400px;" placeholder="{{trans('english.PleaseRoute')}}" tip="{{trans('english.PleaseRoute')}}"></dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl style="margin-top: 30px;">
                                <dt></dt>
                                <dd><input type="submit" name="sub" id="sub" class="sub" value="{{trans('english.conservation')}}"></dd>
                            </dl>
                        </div>
                    </div>
                </form>
                {{--//注册表单--}}
            </div>
        </div>
    </div>
@endsection
@section('footerjs')
    @parent
    <script type="text/javascript">
        $("#leftnav_data").addClass("active");
    </script>
    <!--弹出层显示职位诱惑posTemptation插件-->
    <div class="showPosTemptation" id="showPosTemptation"></div>
    <script type="text/javascript" src="{{asset('/default/js/jquery/enjquery.posTemptation.js')}}"></script>

    <!--选择地图定位map-->
    <div id="twobox_sceen" class="twobox_sceen"></div>
    <script type="text/javascript" src="{{asset('/default/js/company/ensetmap.js')}}"></script>

    <!--弹出层显示时间加载插件-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.autoTime.js')}}"></script>

    <script type="text/javascript" src="{{EnResources::jsOption('company')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.validate.extend.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.enplaceholder.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/company/enregisterBasic.js')}}"></script>

    <!--地区三级联动-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/enjquery.select.area.js')}}"></script>

    {{--JS信息--}}
    <script type="text/javascript">
        //分帧显示地址
        var iframeMapUrl = "{{ url('company/english/iframe_map') }}";
        $(function(){
            var selectComkind = $("#comkind").select({optionData: option_comkind, selected:{{$CompanyBasic->comkind}}});
            //为这个对象添加一个新元素
            option_industry.unshift({"text": "{{trans('english.PleaseSelect')}}", "value": ''});
            var selectIndustry = $("#industry").select({
                optionData: option_industry,
                selected: '{{$CompanyBasic->industry}}'
            });
            var selectEmployee_num = $("#employee_num").select({
                optionData: option_employee_num,
                selected: '{{$CompanyBasic->employee_num}}'
            });
            //公司诱惑
            var comTemp = ["Weekend", "Bag eats", "Wrap", "Five", "Accumulation", "Annual", "Tourism", "Train", "Paid", "Holiday", "Regular", "Shuttle", "Overtime", "Traffic",
                "Telephone", "Esop", "Promotion", "8 hour work", "Project", "Many", "Office tall", "Staff", "Gym", "Activity", "With car"];
            $("#selTemptation").posTemptation({
                posArr: comTemp,                               //传入职位诱惑数组
                showPosTemptation: '#showPosTemptation',       //追加到什么位置
                posTemptation: "#temptation",                  //赋值到某个表单的值
                showTemptation: "#showTemptation",              //显示到某个表单的值
                ismod: '1'
            });

            //基于包装集autoTime函数插件
            $("#showTime").autoTime({
                year: "year",                               //弹出层年份
                month: "month",                             //弹出层月份
                established: '#established'                 //成立年份id
            });

            //地区联动
            $("#region").selectArea({
                'province': $('#province'),
                'area': $('#area'),
                'city': $('#city'),
                'selected': "{{$CompanyBasic->region}}"
                //'provinceNull':true,
                //'areaNull':true,
                //'cityNull':true
            });

            @if(session('ok'))
            layer.ready(function(){
                layer.msg("{{session('ok')}}");
            });
            @endif
        });
    </script>
@endsection
